package response;

import enums.Status;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class BaseResponse<T> {
    private Integer code;  // 状态码
    private String msg;  // 状态描述信息
    private T data;  // 响应数据

    public BaseResponse(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BaseResponse(Status status) {
        this.code = status.getCode();
        this.msg = status.getMsg();
    }
}
